import { Component, OnInit } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { BoardGroupCollectVo } from 'src/app/model/board-group-collect-vo';
import { BoardGroupService } from 'src/app/services/board-group.service';
import { BtnNaviSharedService } from 'src/app/services/btn-navi-shared.service';

@Component({
  selector: 'app-list',
  templateUrl: './list.component.html',
  styles: [``]
})
/**
 * 版块中心
 * @constructor
 */
export class ListComponent implements OnInit {
  public items: BoardGroupCollectVo[] = [];
  public errorMessage: string = '';

  constructor(
    private title: Title,
    private boardGroupService: BoardGroupService,
    private btnNaviSharedService: BtnNaviSharedService) {
    this.btnNaviSharedService.active(true);//需要全局的导航
  }

  ngOnInit(): void {
    this.title.setTitle('论坛首页');
    //不显示默认版块组及其版块
    this.boardGroupService.getAll(false).subscribe(res=>this.items=res);
  }

}
